namespace NUM_OVERFLOW {

	namespace bad_1 {
	
		typedef unsigned long long uint64_t;
		typedef unsigned int uint32_t;
		uint64_t foo(uint32_t x, uint32_t y) {
			uint64_t z;
			z = (uint64_t)(x * y);
			z = (uint64_t)(y * 1000000U);
			return z;
		}
	
	}

	namespace bad_2 {
		typedef unsigned long long uint64_t;
		typedef unsigned int uint32_t;
		uint32_t get_val();
		uint64_t foo(uint32_t x, uint32_t y) {
			uint64_t z;
			z = (uint64_t)(y * get_val());
			return z;
		}
	}

	namespace good_1 {
		typedef unsigned long long uint64_t;
		typedef unsigned int uint32_t;
		uint64_t foo(uint32_t x, uint32_t y) {
			uint64_t z;
			z = (uint64_t)(x)*y;
			z = (uint64_t)(y) * 1000000U; //or: y*1000000ULL
			return z;
		}
	}

	namespace good_2 {
		typedef unsigned long long uint64_t;
		typedef unsigned int uint32_t;
		uint32_t get_val();
		uint64_t foo(uint32_t x, uint32_t y) {
			uint64_t z;
			z = (uint64_t)(y)*get_val();
			return z;
		}
	}
}